package org.example.mybatis.session;

/**
 * 构建SqlSessionFactory的工具类
 */
public class SqlSessionFactoryBuilder {

    /**
     * 根据配置文件创建SqlSessionFactory
     */
    public SqlSessionFactory build(String resource) {
        Configuration configuration = new Configuration();
        configuration.parse(resource);
        return new DefaultSqlSessionFactory(configuration);
    }
}